
package com.the9tcat.deliverycoming.modle;

/**
 * The Class DeliveryDetail.
 *  注意，我重写了equal方法，以 trackid 和 time作为是否相等的标准
 * @author ximi
 */
public class DeliveryDetail {
    /**
     * db auto increatment id
     */
	private int id = -1;
	
    /** The m track id. */
    private int mTrackId;

    /** The m time. */
    private String mTime;

    /** The m status. */
    private String mStatus;
    
    
    public DeliveryDetail(){
    	
    }
    
    public DeliveryDetail(int trackId,String time,String status){
    	this.mTrackId = trackId;
    	this.mTime = time;
    	this.mStatus = status;
    }

    /**
     * Sets the time.
     * 
     * @param time the new time
     */
    public void setTime(String time) {
        this.mTime = time;
    }

    /**
     * Gets the time.
     * 
     * @return the time
     */
    public String getTime() {
        return mTime;
    }

    /**
     * Sets the status.
     * 
     * @param status the new status
     */
    public void setStatus(String status) {
        this.mStatus = status;
    }

    /**
     * Gets the status.
     * 
     * @return the status
     */
    public String getStatus() {
        return mStatus;
    }

    /**
     * Sets the track id.
     *
     * @param trackId the new track id
     */
    public void setTrackId(int trackId) {
        this.mTrackId = trackId;
    }

    /**
     * Gets the track id.
     *
     * @return the track id
     */
    public int getTrackId() {
        return mTrackId;
    }

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	@Override
	public int hashCode() { 
		int result = 17;
		result = 31 * result + this.mTime.hashCode();
		result = 31 * result + this.mTrackId;
		return result;
	}
	
	@Override
	public boolean equals(Object o) {
		if(o instanceof DeliveryDetail){
			DeliveryDetail dd = (DeliveryDetail)o;
			if(dd.getTime()==null){
				return false;
			}
			return (dd.getTrackId()==this.mTrackId)&&(dd.getTime().equals(this.mTime));
		}
		return false;
	}
    
}
